#include "ffmpeg/tool_ffmpeg.h"

#include <iostream>
#include <string>
#include <thread>
#include <chrono>

int main(int argc, char const *argv[])
{
    std::cout << "begin main" << std::endl;
    if (argc != 4)
    {
        std::cerr << "fail get parameters" << std::endl;
        std::cout << "please input y4m file, yuv dir" << std::endl;
        exit(1);
    }
    int convert_type = std::stoi(argv[1]);
    tool::ffmpeg::ToolFfmpeg tf;
    if (convert_type == 0)
    {
        std::string y4m_path(argv[2]);
        std::string yuv_dir(argv[3]);
        tf.ConvertY4mToYuv(y4m_path, yuv_dir);
    }
    else
    {
        std::string yuv_path = argv[2];
        std::string img_path = argv[3];
        tf.ConvertYuvToJpgPng(yuv_path, img_path);
    }

    std::cout << "end main" << std::endl;
    return 0;
}
